package com.example.demo.redis.mapper;

import com.example.demo.model.Material;
import org.apache.ibatis.annotations.*;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * Created by Administrator on 2018/12/27.
 */
@Mapper
public interface RedisMapper {
    @Select("select * from material where id = #{id}")
    List<Material> queryMaterials(@Param("id")Integer id);

    @Update("update material set materialCode=#{materialCode},materialName=#{materialName} where id=#{id}")
    int updataMaterial(Material material);

    @Select("select * from material where id = #{id}")
    List<Material> queryMaterialById(@Param("id")Integer id);

    @Delete("delete from material where id=#{id} ")
    void deleteMaterialById(@Param("id") Integer id);
}
